<!--
 * @Description: 
 * @Author: Liu Kunpeng
 * @Date: 2021-03-12 19:14:51
-->
<template>
    
    <div>
        <!-- <h3>欢迎使用医疗器械管理系统</h3> -->
        <div class="box">
            <el-card class="card1" shadow="hover">
                <span>记录总数</span> 
                <el-divider></el-divider>
                <p class="count">{{patientCount}}</p>
                <router-link :to="'DataManage'">记录总数</router-link>
            </el-card>
        </div>
    
    </div>
</template>

<script>
import { getPatientCountApi } from '@/api/index'
export default {
    data(){
        return{
            patientCount:0,
        }
    },
    methods: {
        getPatientCount(){
            getPatientCountApi().then(res =>{
                this.patientCount = res.data.counts
            })
        }
        // async getPatientCount(){
        //     const{data:res} = await this.$http.get("/hospital/getPatientNum");
        //     this.patientCount = res.count;
        // },
        // async getDeviceCount(){
        //     const{data:res} = await this.$http.get("/device/getDeviceCount");
        //     this.deviceCount = res.count;
        // }
    },
    created(){
        this.getPatientCount();
    }

}
</script>


<style lang="less" scoped>
.box{
    float: left;
    margin-top: 10px;
}
.card1{
    width: 350px;
    height: 250px;
    margin-left: 30px;
    margin-bottom: 20px;
    overflow:auto;
}
.count{
    font-size: 200%;
    font-weight: 600;
    color: #909399;
}
</style>